#include <stdio.h>
#include "single_linked.h"


int main(int argc, char* argv[])
{
    // 创建
    SINGLE_LINKED_NODE_T *pHead = create_linked_tanks();

    // 链表遍历
    SINGLE_LINKED_NODE_T *pX = pHead;
    while(pX != NULL)
    {
        printf("Tank #%-2d -> %2d\n", pX->tank.nTankNo, pX->tank.nAmmo);
        pX = pX->pNext;
    }

    // 销毁
    int count = destroy_linked_tanks(pHead);
    printf("%d tanks have been freed.\n", count);

    return 0;
}